package com.example.demo;

import org.slf4j.Logger;

import java.util.PriorityQueue;

public class psvm {

    private static Integer log;
    public static void main(String[] args) {
        PriorityQueue<Integer> queue = new PriorityQueue<Integer>();      //优先级队列
        for (int i = 0; i < 10; i++) {             //将数组中元素入队
            queue.offer(i);
        }
        int[] result = new int[10];
        for (int i = 0; i < 10; i++) {               //出队k个元素
            result[i] = queue.poll();
        }


    }
}
